OmniWeb „Éò„É´„Éó

OmniWeb ヘルプ:OmniWeb で AppleScript を使用する

OmniWeb で AppleScript を使用する

OmniWeb では、スクリプト言語である AppleScript を用いて様々なことができます。

OmniWeb でスクリプト制御できるすべてのオブジェクトを見るには、OmniWeb のアイコンを Apple のスクリプトエディタのアイコンにドラッグ&ドロップしてください。スクリプト辞書を見ることができます。スクリプトエディタは、デフォルトでは /Applications/AppleScript/ にあります。

AppleScript のサンプル

このスクリプトでは、ブラウザウインドウ内のすべてのタブを閉じ、代わりに個別のウインドウで開きます。

tell application "OmniWeb"
     set theBrowser to front browser
     if (count tabs of theBrowser) > 1 then
          repeat until (count tabs of theBrowser) = 1
               set theTab to second tab of theBrowser
               set theAddress to address of theTab
               make new browser at end of browsers with properties {address:theAddress}
               delete theTab
          end repeat
     end if
     set has tabs of theBrowser to false
end tell

This one creates a single window with tabs from all the tabs in each window you have open.このスクリプトでは、開いているすべてのブラウザウインドウを一つのウインドウにまとめてタブで表示します。

tell application "OmniWeb"
     set mainBrowser to front browser
     set frontID to id of front browser
     set background to (every browser whose id is not frontID)
     repeat with theBrowser in background
          set theAddress to address of theBrowser
          tell mainBrowser to make new tab at end of tabs with properties {address:theAddress}
          close theBrowser
     end repeat
end tell

OmniWeb で使用できる AppleScript は他にも omnigroup.com の OmniWeb の製品紹介ページ の Extras の項目で紹介しております。

Copyright © 2004-2005 The Omni Group